package or;

public class T6307 {
    public int passThePillow(int n, int time) {

        n=n-1;
        time=time%(2*n);
        if (time>n){
            return 2*n-time+1;
        }else {
            return time+1;
        }
    }
}
